/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "eme_signos_sintomas")
@NamedQueries({
    @NamedQuery(name = "EmeSignosSintomas.findAll", query = "SELECT e FROM EmeSignosSintomas e")})
public class EmeSignosSintomas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ess_id")
    private Integer essId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "ess_nombre")
    private String essNombre;
    @Column(name = "ess_puntaje")
    private Integer essPuntaje;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ess_estado")
    private int essEstado;
    @JoinTable(name = "eme_triaje_signos_relevantes", joinColumns = {
        @JoinColumn(name = "ess_id", referencedColumnName = "ess_id")}, inverseJoinColumns = {
        @JoinColumn(name = "etr_id", referencedColumnName = "etr_id")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<EmeTriaje> emeTriajeList;

    public EmeSignosSintomas() {
    }

    public EmeSignosSintomas(Integer essId) {
        this.essId = essId;
    }

    public EmeSignosSintomas(Integer essId, String essNombre, int essEstado) {
        this.essId = essId;
        this.essNombre = essNombre;
        this.essEstado = essEstado;
    }

    public Integer getEssId() {
        return essId;
    }

    public void setEssId(Integer essId) {
        this.essId = essId;
    }

    public String getEssNombre() {
        return essNombre;
    }

    public void setEssNombre(String essNombre) {
        this.essNombre = essNombre;
    }

    public Integer getEssPuntaje() {
        return essPuntaje;
    }

    public void setEssPuntaje(Integer essPuntaje) {
        this.essPuntaje = essPuntaje;
    }

    public int getEssEstado() {
        return essEstado;
    }

    public void setEssEstado(int essEstado) {
        this.essEstado = essEstado;
    }

    public List<EmeTriaje> getEmeTriajeList() {
        return emeTriajeList;
    }

    public void setEmeTriajeList(List<EmeTriaje> emeTriajeList) {
        this.emeTriajeList = emeTriajeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (essId != null ? essId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmeSignosSintomas)) {
            return false;
        }
        EmeSignosSintomas other = (EmeSignosSintomas) object;
        if ((this.essId == null && other.essId != null) || (this.essId != null && !this.essId.equals(other.essId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.EmeSignosSintomas[ essId=" + essId + " ]";
    }
    
}
